<template>
  <view class="login-container">
    <view class="title">登录</view>
    <view class="form-item">
      <text>请输入用户名</text>
      <input type="text" v-model="username" placeholder="账号" />
    </view>
    <view class="form-item">
      <text>请输入密码</text>
      <input type="password" v-model="password" placeholder="密码" />
    </view>
    <button class="login-btn" @click="login">登录</button>
    <navigator url="/pages/注册/zhuce/zhuce" class="register-link">没有账号？去注册</navigator>
  </view>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: ''
    };
  },
  methods: {
    login() {
      uni.showToast({
		
        title: '登录成功',
        icon: 'success'
      });
	  uni.setStorage({
	  	key:'userName',
		data:this.username,
		success:function(){
			console.log("setStorage");
		}
	  })
	  uni.switchTab({
	  	url:"/pages/cardViewPage/cardViewPage"
	  })
    }
  }
};
</script>

<style scoped>

</style>
